home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGNG_C
/
TCHK060.LZH
/
VIDEO.H
< prev
Wrap
C/C++ Source or Header
|
1988-01-15
|
3KB
|
75 lines
/* TCHK 0.60 - Howard Kapustein's Turbo C library 1-15-88 */
/* Copyright (C) 1988, Howard Kapustein. All rights reserved. */
/* video.h - header file for VIDEO.C - screen output routines */
#include <howard.h>
#ifndef VIDEO
#define VIDEO 0x10 /* VIDEO INTerrupt service = 16 (HEX 10) */
#define MODE *((byte far *) 0x449lu) /* current video mode */
#define PAGE *((byte far *) 0x462lu) /* current display page */
#define PAGELEN *((unsigned int far *) 0x44Clu) /* current page length (regen buffer) */
#define VIDOFFSET *((unsigned int far *) 0x44Elu) /* offset from start of video */
#define ROWCOUNT *((byte far *) 0x484lu) /* # rows minus 1 on display (EGA,PGA) */
#define CHARHEIGHT *((unsigned int far *) 0x485lu) /* character height: # bytes/char, # scan lines/char (EGA,PGA) */
#define CURSOR_UNDERBAR (MODE==7)?0x0B0C:0x0607 /* cursor type: underbar (default) */
#define CURSOR_HALFBLOCK (MODE==7)?0x070C:0x0407 /* cursor type: half-block */
#endif
/* Global variables */
/* These have already been defined, they are just listed here for your
reference. Do not uncomment these variables.
byte frame1[9] = {'┌','─','┐','│','┘','─','└','│','\0'};
byte frame11[5] = {'┬','├','┴','┤','┼'};
byte frame12[6] = {'╓','╞','╨','╡','╫','╪'};
byte frame2[9] = {'╔','═','╗','║','╝','═','╚','║','\0'};
byte frame21[6] = {'╤','╟','╧','╢','╪','╫'};
byte frame22[5] = {'╦','╠','╩','╣','╬'};
byte frame0[9] = {' ',' ',' ',' ',' ',' ',' ',' ','\0'};
*/
/* function prototypes */
void cls(void);
void clear(int top, int left, int bottom, int right);
void gotoxy(int x, int y);
byte wherex(void); /* returns X-coord of cursor */
byte wherey(void); /* returns Y-coord of cursor */
byte whatxy(byte *attrib); /* read character/attribute at cursor */
void read_mode(byte *width, byte *mode, byte *page);
void set_mode(byte mode);
int box(int top, int left, int bottom, int right, byte frame[]);
void horiz_line(byte c, unsigned int len, byte row, byte col);
void vert_line(byte c, unsigned int len, byte row, byte col);
void putk(byte c);
void putstr(byte *c); /* INTerrupt output */
void putsay(byte row, byte col, byte *c); /* direct screen writes */
unsigned int read_cursor(byte *row, byte *col); /* returns CX reg, scan lines */
void set_cursor(byte start, byte end); /* set cursor scan lines */
void cursor_off(void);
void cursor_on(void);
void cursor_flip(unsigned int curs1, unsigned int curs2); /* toggle cursor type */
void cursor_blink(boolean fast);
void set_color(byte colors);
boolean isMDA(void);
boolean isHerc(void);
boolean isEGA(void);
boolean isCGA(void);
void save_screen(byte *buffer); /* saves screen to buffer */
void save_box(byte top, byte left, byte bottom, byte right, byte *buffer);
void restore_screen(byte *buffer); /* restores screen from buffer */
void restore_box(byte top, byte left, byte bottom, byte right, byte *buffer);
void scroll_up(byte top, byte left, byte bottom, byte right);
void scroll_down(byte top, byte left, byte bottom, byte right);
#ifndef ismono()
#define ismono() isMDA()|isHerc()
#define iscolor() !ismono()
#endif
#ifndef scrbuff()
#define scrbuff(t,l,b,r) (b-t+1)*(r-l+1)*2
#endif